/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author lzw
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '../model/baseModel';
import { UploadApiResult } from '../sys/upload';
import { UploadFileParams } from '/#/axios';

const { ctxPath, adminPath } = useGlobSetting();

export interface FtdsOrder extends BasicModel<FtdsOrder> {
  orderDdss?: string; // 订单所属
  orderDdh?: string; // 订单号
  orderFkzt?: string; // 放款主体
  orderFkje?: string; // 放款金额
  orderFkrq?: string; // 放款日期
  orderSybj?: string; // 剩余本金
  orderSylx?: string; // 剩余利息
  orderSyfx?: string; // 剩余罚息
  orderJkqs?: string; // 借款期数
  orderYqrq?: string; // 逾期日期
  orderAjjz?: string; // 案件进展
  orderLazt?: string; // 立案状态
  orderShyj?: string; // 审核意见
  orderApp?: string; // APP
  orderDbfmc?: string; // 担保方名称
  orderDcje?: string; // 代偿金额
  orderDcrq?: string; // 代偿日期
  orderBz?: string; // 备注
}

export const ftdsOrderList = (params?: FtdsOrder | any) =>
  defHttp.get<FtdsOrder>({ url: adminPath + '/operating/ftdsOrder/list', params });

export const ftdsOrderListData = (params?: FtdsOrder | any) =>
  defHttp.post<Page<FtdsOrder>>({ url: adminPath + '/operating/ftdsOrder/listData', params });

export const ftdsOrderForm = (params?: FtdsOrder | any) =>
  defHttp.get<FtdsOrder>({ url: adminPath + '/operating/ftdsOrder/form', params });

export const ftdsOrderSave = (params?: any, data?: FtdsOrder | any) =>
  defHttp.postJson<FtdsOrder>({ url: adminPath + '/operating/ftdsOrder/save', params, data });

export const ftdsOrderImportData = (
  params: UploadFileParams,
  onUploadProgress: (progressEvent: ProgressEvent) => void,
) =>
  defHttp.uploadFile<UploadApiResult>(
    {
      url: ctxPath + adminPath + '/operating/ftdsOrder/importData',
      onUploadProgress,
    },
    params,
  );

export const ftdsOrderDelete = (params?: FtdsOrder | any) =>
  defHttp.get<FtdsOrder>({ url: adminPath + '/operating/ftdsOrder/delete', params });
